package com.fxm.controller;

import com.fxm.returns.RespEntity;
import com.fxm.service.RankService;
import com.fxm.vo.param.RankParam;
import com.fxm.vo.result.RankResult;
import io.swagger.annotations.Api;
import java.util.List;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 排行榜 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2021-01-07
 */
@RestController
@RequestMapping("/rank")
@Slf4j
@Api(value = "排行榜接口", tags = "排行榜接口")
public class RankController {

    @Resource
    private RankService rankService;

    @PostMapping("/list")
    @ApiOperation(value = "排行榜数据")
    public RespEntity<List<RankResult>> listRank(@RequestBody RankParam rankParam) {
        RespEntity<List<RankResult>> respEntity = rankService.listRank(rankParam);
        return respEntity;
    }

}
